package com.example.appointment.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import com.example.appointment.R;


public class WelcomActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        initView();

//        new Thread() {
//            @Override
//            public void run() {
//                super.run();
//                try {
//                    CmnObjectFuncs.saveToSDCard("text.mp4", WelcomActivity.this, R.raw.test);
//                } catch (Throwable throwable) {
//                    throwable.printStackTrace();
//                }
//            }
//        }.start();


        handler.sendEmptyMessageDelayed(0, 2000);
    }

    private Handler handler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);

//            User user = UserManager.getInstance().getUser(mContext);
//            if (user == null) {
            Intent it = new Intent(WelcomActivity.this, LoginActivity.class);
            startActivity(it);
//            } else {
//                Intent it = new Intent(WelcomActivity.this, ChooseBusinessActivity.class);
//                startActivity(it);
//            }
        }
    };

    /**
     * 初始化数据
     */
    private void initView() {

    }


    @Override
    protected void onDestroy() {
        handler.removeMessages(0);
        super.onDestroy();
    }
}
